<?php
/**
 * Created by PhpStorm.
 * User: edmmss
 * Date: 2018/11/15
 * Time: 14:25
 */

namespace app\modules\adapter;


class EBookAdapter implements BookInterface
{
    protected $eBook;

    public function __construct(EBookInterface $eBook)
    {
        $this->eBook = $eBook;
    }

    /**
     * className
     *
     * @date   2018/11/15
     * @author edmmss
     * @return mixed
     */
    public function turnPage()
    {
        // TODO: Implement turnPage() method.
        $this->eBook->pressNext();
    }

    /**
     * className
     *
     * @date   2018/11/15
     * @author edmmss
     * @return mixed
     */
    public function open()
    {
        // TODO: Implement open() method.
        $this->eBook->unlock();
    }

    /**
     * className
     *
     * @date   2018/11/15
     * @author edmmss
     * @return int
     */
    public function getPage(): int
    {
        // TODO: Implement getPage() method.
        return $this->eBook->getPage()[0];
    }
}